# 编写学员实体类，对应属性包含：学号、姓名、性别。
# 编写学员名单管理类，实现删除学员方法、查询学员方法。
'hogwarts\'s lassroom'
class Student:
    """
    自己根据题目要求实现
    """
    def __init__(self,student_id:int,student_name:str,student_sex:str):
        self.student_id = student_id
        self.student_name = student_name
        self.student_sex = student_sex
        print(f'{self.student_id}  {self.student_name}  {self.student_sex}')




class StudentList:
    def __init__(self, student_list):
        self.s_list = student_list



    def get(self, student_id):
        """
        根据 student_id 查询信息
        """


        for i in self.s_list:
            if student_id == i.student_id:
                print(f'{i.student_id}  {i.student_name}  {i.student_sex}')





    def delete(self, student_id):
        """
        根据 student_id 删除信息
        """
        for i in self.s_list:
            if student_id == i.student_id:
                str(self.s_list)
                k = self.s_list.pop(self.s_list.index(i))
                print(f'{i.student_id}  {i.student_name}  {i.student_sex}')
                print('----删除后的学生列表----')
                for j in self.s_list:
                    print(f'{j.student_id}  {j.student_name}  {j.student_sex}')

if __name__ == '__main__':
    # 入参自己定义
    print('------学生列表------')
    s1 = Student(1,'柯南','male')
    s2 = Student(2,'小兰','femal')
    s3 = Student(3,'灰原哀','femal')
    # 初始化一个成员名单
    s_list = StudentList([s1, s2, s3])

    # 实现get()方法
    print('-----学生信息查询-----')
    s_list.get(2)
    # 实现delete
    print('-----被删除的学生-----')
    s_list.delete(2)
